package algotithm.weekendrace.leetcode242.test1;

/**
 * @author 25068
 * @Date 2021/5/23 12:04
 */
class Solution {
    public boolean checkZeroOnes(String s) {
        char[] c = s.toCharArray();
        int one = 0;
        int zero = 0;
        int max1 = 0;
        int max0 = 0;
        for (int i = 0; i < c.length; i++) {
            if (c[i] == '1') {
                one++;
                zero = 0;
            } else {
                zero++;
                one = 0;
            }
            max1 = Math.max(max1,one);
            max0 = Math.max(max0,zero);
        }
        return max1 > max0;
    }
}

